/*
 * @Author: linjie linjie@gysk.com.cn
 * @Date: 2023-07-06 11:37:18
 * @LastEditors: linjie linjie@gysk.com.cn
 * @LastEditTime: 2024-05-09 14:42:20
 * @FilePath: \esale-pc-frontend\src\views\appMsg\mock\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Mock from 'mockjs'
import { CONSTANT_OBJ } from '@/utils/constant'
let baseURL
let locationHref = `http://${window.location.hostname}`
if (CONSTANT_OBJ.ENV !== 'prodMaster') {
  baseURL = CONSTANT_OBJ.URL + CONSTANT_OBJ.PREFIX + '/user'
  // baseURL = URL
} else {
  baseURL = locationHref + CONSTANT_OBJ.PREFIX + '/user'
}
// 用户列表查询
Mock.mock(`${baseURL}/v1/api/user/dialog/queryByCondition`, function () {
  return {
    ...CONSTANT_OBJ.MOCK_RESPONSE,
    data: {
      total: 4,
      list: [
        { id: '1', dialogTitle: '下班回公司开会', dialogDesc: '下班回公司开会', receive: '所有人', status: '1', updateBy: '李小明', updateTime: '2022-08-05-12:23:12' },
        { id: '2', dialogTitle: '明天下班回公司开会', dialogDesc: '明天下班回公司开会', receive: '指定机构', status: '0', updateBy: '李小明', updateTime: '2022-08-05-12:23:12' },
        { id: '3', dialogTitle: '今晚投产', dialogDesc: '今晚投产', receive: '指定人员', status: '0', updateBy: '李小明', updateTime: '2022-08-05-12:23:12' },
        { id: '4', dialogTitle: '明天放假', dialogDesc: '明天放假', receive: '指定人员', status: '0', updateBy: '李小明', updateTime: '2022-08-05-12:23:12' }
      ]
    }
  }
})

// 新增弹框提示
Mock.mock(`${baseURL}/v1/api/user/dialogTip/add`, function () {
  return {
    ...CONSTANT_OBJ.MOCK_RESPONSE
  }
})
// 编辑弹框提示
Mock.mock(`${baseURL}/v1/api/user/dialogTip/edit`, function () {
  return {
    ...CONSTANT_OBJ.MOCK_RESPONSE
  }
})

// 失效弹框提示
Mock.mock(`${baseURL}/v1/api/user/dialogTip/close`, function () {
  return {
    ...CONSTANT_OBJ.MOCK_RESPONSE
  }
})

// 生效弹框提示
Mock.mock(`${baseURL}/v1/api/user/dialogTip/open`, function () {
  return {
    ...CONSTANT_OBJ.MOCK_RESPONSE
  }
})

// 置顶弹框提示
Mock.mock(`${baseURL}/v1/api/user/dialogTip/top`, function () {
  return {
    ...CONSTANT_OBJ.MOCK_RESPONSE
  }
})

// 删除弹框提示
Mock.mock(`${baseURL}/v1/api/user/dialogTip/del/2`, function () {
  return {
    ...CONSTANT_OBJ.MOCK_RESPONSE
  }
})
